<?
	/**
	 * @todo 道具列表 购买
	 * @author 任彦杰
	 */
	define('_VIEW_MODEL_','default');
	require_once("./init.php");
	$uid = isset($uid)?intval($uid):"";
	$uid = empty($uid)?$uid = getUserId():$uid;
	if(isset($page)){
		$page = intval($page);
	}else{
		$page = 1;
	}	
	$pageSize            = 2; //每页显示记录数
	$stat = ($page-1)*$pageSize;
	$rs = $db->Execute("select * from {$telper}prop where state = 0 order by rank desc limit $stat,$pageSize");
	$propinfo = $rs ->GetArray();
	$html = '';
	if ($propinfo){
	foreach ($propinfo as $key => $value){
		$html .= $key+1;
		$html .= '.[道具名称]<a href="./props.php?uid='.$uid.'&amp;pid='.$value['id'].'">'.$value['title'].'</a><br/>';
		$html .= '简介：'.truncateutf8($value['summary'],50,'').'<br/>';
		$html .= '<a href="./props.php?uid='.$uid.'&amp;pid='.$value['id'].'">进入查看更多</a>'.'<br/>';
		$html .= '------------'.'<br/>';
	}
	}
	$num = $db->GetRow("select count(id) as total from {$telper}prop where state = 0 order by rank desc");

	require_once INC.'/pageclass.php';
	header("Content-type:text/vnd.wap.wml;charset=utf-8");
	$pageObj = new Page($num['total'],$pageSize,$smartyObj);
	$smartyObj->assign('title',$adminproplist);
	$smartyObj->assign("uid",$uid);
	$smartyObj->assign('propinfo',$html);
	$smartyObj->display('propslist.tpl');
?>